﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using TowerDefence.Entities.States;

namespace TowerDefence.Entities.Actions
{
    /// <summary>
    /// Causes an entity to die
    /// </summary>
    public class DieAction : Action
    {
        public DieAction(Entity _userEntity, params Entity[] _targetEntities) : base(_userEntity, _targetEntities) { }

        public override void DoAction(TimeSpan _time)
        {
            var aliveState = this.userEntity.Form.States.GetState<AliveState>();
            if (aliveState != null)
            {
                aliveState.LifeState = eLifeState.Dead;
            }
        }
    }
}
